﻿using nhannguyentn.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace nhannguyentn.Controllers
{
    public class BlogCategoryController : Controller
    {
        //
        // GET: /Category/

        public ActionResult Index()
        {
            return View();
        }

        public object GetCategories()
        {
            var cat = BlogCategoryModel.Objects.ToList();
            return Json(cat, JsonRequestBehavior.AllowGet);
        }

        public ActionResult Post()
        {
            return View();
        }

        [HttpPost, ValidateInput(false)]
        public ActionResult Post(BlogPostModel model)
        {
            model.Insert(true);
            return View();
        }
    }
}
